package com.ybwh.springboot2.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

/**
 * <p>
 *  注意  componentModel  为spring 时需要加注解@Component
 * </p>
 *
 * @author fanbeibei
 * @version 1.0.0
 * @date 2022/3/13 13:36
 */
//@Component
@Named("MyConvert")
public class MyConvert {

    @Named("myTransformation2")// or your custom @Qualifier annotation
    public String customConveter(Pos pos) {
        if (null == pos) {
            return null;
        }
        return pos.getName();
    }


    @Named("myTransformation1")// or your custom @Qualifier annotation
    public String customConveter1(Pos pos) {
        if (null == pos) {
            return null;
        }
        return pos.getName();
    }

    @Named("int2str")
    public String int2str(Pos pos) {
        if (null == pos) {
            return null;
        }
        return pos.getName();
    }

    @Named("int2str2")
    public String int2str2(Pos pos) {
        if (null == pos) {
            return null;
        }
        return pos.getName();
    }

}
